//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package javax.vpncrypto;

import java.io.Serializable;
import java.security.Permission;
import java.security.PermissionCollection;
import java.util.Enumeration;
import java.util.Vector;

final class CryptoPermissionCollection extends PermissionCollection implements Serializable {
    private static final long serialVersionUID = -511215555898802763L;
    private Vector<Permission> permissions = new Vector(3);

    CryptoPermissionCollection() {
    }

    public void add(Permission var1) {
        if (this.isReadOnly()) {
            throw new SecurityException("attempt to add a Permission to a readonly PermissionCollection");
        } else if (var1 instanceof javax.vpncrypto.CryptoPermission) {
            this.permissions.addElement(var1);
        }
    }

    public boolean implies(Permission var1) {
        if (!(var1 instanceof javax.vpncrypto.CryptoPermission)) {
            return false;
        } else {
            javax.vpncrypto.CryptoPermission var2 = (javax.vpncrypto.CryptoPermission)var1;
            Enumeration var3 = this.permissions.elements();

            javax.vpncrypto.CryptoPermission var4;
            do {
                if (!var3.hasMoreElements()) {
                    return false;
                }

                var4 = (javax.vpncrypto.CryptoPermission)var3.nextElement();
            } while(!var4.implies(var2));

            return true;
        }
    }

    public Enumeration<Permission> elements() {
        return this.permissions.elements();
    }
}
